<html>
<head>
  <meta charset="UTF-8">
  <title>indexcontroller</title>
</head>
<body>

  <?php 
  require 'Controller.php';
  require 'Home/Model/IndexModel.php';
  
  class IndexController extends Controller{
  
    function __construct(){
      parent::__construct();
    }
     function index(){
        $model=new IndexModel();
       $data=$model->getIndexList();

        $this->assign('index',$data);
       $this->display();
      }

      function login()
      {
         $this->display();
      }

      function loginn(){
         $uname=$_POST["uname"];
          $password=$_POST["password"];
          $pole=$_POST["pole"];
           $model=new  IndexModel();
       $result=$model->loginn($uname,$password,$pole);
            if ($result) {
            echo "   欢迎您  ";
            echo $uname;
            /* $_SESSION["uname"]=$uname;*/
             
                 if($pole==1){
                        header("refresh:3;url='index.php?c=index&m=index'");
                          } 
                 else
                    {
                         header("refresh:3;url='admin.php?c=user&m=menu'");
                        }
                      }
               else
               {
                       echo "请重试，3秒后返回注册页面重新登陆";
                       header("refresh:3;url='index.php?c=index&m=login'");
               }
}
   function movie()
   {
     
    $model=new IndexModel();
    $data=$model->getList();
    $this->assign('video',$data);
    $this->display();


   }

   function music()
   {
     
    $model=new IndexModel();
    $data=$model->musicList();
    $this->assign('video',$data);
    $this->display();


   }

   function tv()
   {
     
    $model=new IndexModel();
    $data=$model->tvList();
    $this->assign('video',$data);
    $this->display();


   }

 function show()
  {
    $vid=$_GET['vid'];
     $model=new IndexModel();
     $data=$model->showList($vid);
     $this->assign('video',$data);
     $this->display();
     

 }



   }
  
  ?>
      </body>
      </html>